import 'package:flutter/material.dart';

/// 情绪类型枚举
enum MoodType {
  /// 非常开心
  veryHappy,
  /// 开心
  happy,
  /// 平静
  calm,
  /// 悲伤
  sad,
  /// 愤怒
  angry,
  /// 焦虑
  anxious,
  /// 兴奋
  excited,
  /// 疲惫
  tired,
}

/// 情绪类型扩展
extension MoodTypeExtension on MoodType {
  /// 获取情绪名称
  String get name {
    switch (this) {
      case MoodType.veryHappy:
        return '非常开心';
      case MoodType.happy:
        return '开心';
      case MoodType.calm:
        return '平静';
      case MoodType.sad:
        return '悲伤';
      case MoodType.angry:
        return '愤怒';
      case MoodType.anxious:
        return '焦虑';
      case MoodType.excited:
        return '兴奋';
      case MoodType.tired:
        return '疲惫';
    }
  }

  /// 获取情绪图标
  IconData get icon {
    switch (this) {
      case MoodType.veryHappy:
        return Icons.sentiment_very_satisfied;
      case MoodType.happy:
        return Icons.sentiment_satisfied;
      case MoodType.calm:
        return Icons.sentiment_neutral;
      case MoodType.sad:
        return Icons.sentiment_dissatisfied;
      case MoodType.angry:
        return Icons.sentiment_very_dissatisfied;
      case MoodType.anxious:
        return Icons.psychology_alt;
      case MoodType.excited:
        return Icons.celebration;
      case MoodType.tired:
        return Icons.bedtime;
    }
  }

  /// 获取情绪颜色
  Color get color {
    switch (this) {
      case MoodType.veryHappy:
        return const Color(0xFF4CAF50);
      case MoodType.happy:
        return const Color(0xFF8BC34A);
      case MoodType.calm:
        return const Color(0xFF2196F3);
      case MoodType.sad:
        return const Color(0xFF9E9E9E);
      case MoodType.angry:
        return const Color(0xFFF44336);
      case MoodType.anxious:
        return const Color(0xFFFF9800);
      case MoodType.excited:
        return const Color(0xFFE91E63);
      case MoodType.tired:
        return const Color(0xFF795548);
    }
  }

  /// 获取情绪强度值（1-10）
  int get intensityValue {
    switch (this) {
      case MoodType.veryHappy:
        return 10;
      case MoodType.happy:
        return 8;
      case MoodType.calm:
        return 6;
      case MoodType.sad:
        return 3;
      case MoodType.angry:
        return 2;
      case MoodType.anxious:
        return 4;
      case MoodType.excited:
        return 9;
      case MoodType.tired:
        return 5;
    }
  }

  /// 获取情绪表情符号
  String get emoji {
    switch (this) {
      case MoodType.veryHappy:
        return '😄';
      case MoodType.happy:
        return '😊';
      case MoodType.calm:
        return '😌';
      case MoodType.sad:
        return '😢';
      case MoodType.angry:
        return '😠';
      case MoodType.anxious:
        return '😰';
      case MoodType.excited:
        return '🤩';
      case MoodType.tired:
        return '😴';
    }
  }
}